 <script language="javascript">
	function goback(comid,announid){
		document.forms[0].action='<?=site_url("job_management/goto_title_view")?>/'+ comid + '/'+ announid;
		document.forms[0].submit();
	}
	function goaddnewduty(titleid){
		document.forms[0].action='<?=site_url("job_management/goto_addnew_duty")?>/'+titleid;
		document.forms[0].submit();
	}
	function deleteduty(dutyid,titleid){
		if(confirm("Do you want to delete this duty?","Delete duty")){
			document.forms[0].action='<?=site_url("job_management/delete_duty")?>/'+ dutyid +'/'+ titleid;
			document.forms[0].submit();
		}
	}
</script>
	<h3 class="capture">Job Management</h3>
    <div id="wrap">
    <div id="tdd_selected">
    	<div class="dd_selected">Duty View</div>
        <div class="dd_view"><br />
        <form action="" method="post">
        <div>
        	Title:<input type="text" readonly="readonly" id="txttitle" name="txttitle" value="<?=htmlspecialchars($titledata['title_desc']);?>" />
            <?php 
			$titleid=$titledata['title_id'];
			$comid=$company['com_id'];
			?>
        </div>
        	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="userview">
        		<tr>
        			<th>Duty Id</th>
        			<th>Description</th>
        			<th>Delete</th>
        		</tr>
        		 
        		<?php foreach($all_duties->result() as $duty): 
				?>
                  <tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
                    <td><a href="<?=site_url("job_management/goto_update_duty/$duty->duty_id/$titleid");?>"><?=htmlspecialchars($duty->duty_id);?></a></td>
                   	<td><?=htmlspecialchars($duty->duty_desc);?></td>
                   <td align="center"><img src="<?=base_url();?>images/recyclebin.png" width="20px" height="20px" onclick="deleteduty('<?=$duty->duty_id;?>','<?=$titleid;?>')" /></td>
                  </tr>
              	<?php endforeach; ?>
            </table><br />
           <div align="center">
           <?php $announid=$announ['announ_id'];?>
	           <input type="button" name="btnback" value="Back" class="bottom" onclick="goback('<?=$comid;?>','<?=$announid;?>')" />
	           <input type="button" name="btnaddnew" class="bottom" value="Add New" onclick="goaddnewduty('<?=$titleid;?>')" />
	       </div><br />
        </form>
		</div>
        
    </div> 
      
  </div>


